package com.spddr.pmos.jpa;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import cn.seqdata.jpa.JpaNoGeneratedObject;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.spddr.pmos.domain.GeoLocation;

@Entity
@Table(name = "reservoir_info")
public class Reservoir extends JpaNoGeneratedObject implements GeoLocation {
	private static final long serialVersionUID = 1L;

	private River river;
	private Reservoir spillsInto;
	private Double activeStorageCapacity;
	private Double energyStorageRating;
	private Double fullSupplyLevel;
	private Double grossCapacity;
	private Double normalMinOperateLevel;
	private Double riverOutletWorks;
	private Double spillTravelDelay;
	private Double spillwayCapacity;
	private Double spillwayCrestLength;
	private Double spillwayCrestLevel;
	private Double lng;
	private Double lat;
	private String location;

	public Reservoir() {
	}

	public Reservoir(Long id) {
		super(id);
	}

	public Reservoir(Long id, String name) {
		super(id, name);
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "river")
	@JsonSerialize(using = cn.seqdata.jackson.ObjectSerializer.IdName.class)
	public River getRiver() {
		return this.river;
	}

	public void setRiver(River river) {
		this.river = river;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "spills_into")
	@JsonSerialize(using = cn.seqdata.jackson.ObjectSerializer.IdName.class)
	public Reservoir getSpillsInto() {
		return this.spillsInto;
	}

	public void setSpillsInto(Reservoir spillsInto) {
		this.spillsInto = spillsInto;
	}

	@Column(name = "active_storage_capacity")
	public Double getActiveStorageCapacity() {
		return this.activeStorageCapacity;
	}

	public void setActiveStorageCapacity(Double activeStorageCapacity) {
		this.activeStorageCapacity = activeStorageCapacity;
	}

	@Column(name = "energy_storage_rating")
	public Double getEnergyStorageRating() {
		return this.energyStorageRating;
	}

	public void setEnergyStorageRating(Double energyStorageRating) {
		this.energyStorageRating = energyStorageRating;
	}

	@Column(name = "full_supply_level")
	public Double getFullSupplyLevel() {
		return this.fullSupplyLevel;
	}

	public void setFullSupplyLevel(Double fullSupplyLevel) {
		this.fullSupplyLevel = fullSupplyLevel;
	}

	@Column(name = "gross_capacity")
	public Double getGrossCapacity() {
		return this.grossCapacity;
	}

	public void setGrossCapacity(Double grossCapacity) {
		this.grossCapacity = grossCapacity;
	}

	@Column(name = "normal_min_operate_level")
	public Double getNormalMinOperateLevel() {
		return this.normalMinOperateLevel;
	}

	public void setNormalMinOperateLevel(Double normalMinOperateLevel) {
		this.normalMinOperateLevel = normalMinOperateLevel;
	}

	@Column(name = "river_outlet_works")
	public Double getRiverOutletWorks() {
		return this.riverOutletWorks;
	}

	public void setRiverOutletWorks(Double riverOutletWorks) {
		this.riverOutletWorks = riverOutletWorks;
	}

	@Column(name = "spill_travel_delay")
	public Double getSpillTravelDelay() {
		return this.spillTravelDelay;
	}

	public void setSpillTravelDelay(Double spillTravelDelay) {
		this.spillTravelDelay = spillTravelDelay;
	}

	@Column(name = "spillway_capacity")
	public Double getSpillwayCapacity() {
		return this.spillwayCapacity;
	}

	public void setSpillwayCapacity(Double spillwayCapacity) {
		this.spillwayCapacity = spillwayCapacity;
	}

	@Column(name = "spillway_crest_length")
	public Double getSpillwayCrestLength() {
		return this.spillwayCrestLength;
	}

	public void setSpillwayCrestLength(Double spillwayCrestLength) {
		this.spillwayCrestLength = spillwayCrestLength;
	}

	@Column(name = "spillway_crest_level")
	public Double getSpillwayCrestLevel() {
		return this.spillwayCrestLevel;
	}

	public void setSpillwayCrestLevel(Double spillwayCrestLevel) {
		this.spillwayCrestLevel = spillwayCrestLevel;
	}

	@Column(name = "lng")
	@Override
	public Double getLng() {
		return this.lng;
	}

	public void setLng(Double lng) {
		this.lng = lng;
	}

	@Column(name = "lat")
	@Override
	public Double getLat() {
		return this.lat;
	}

	public void setLat(Double lat) {
		this.lat = lat;
	}

	@Column(name = "location")
	@Override
	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}
}